package com.air;

//import com.alibaba.nacos.api.utils.StringUtils;
//import javafx.application.Application;
//import org.springframework.boot.Banner;
//import org.springframework.boot.ansi.AnsiOutput;
//import org.springframework.boot.builder.SpringApplicationBuilder;
//import org.springframework.context.ConfigurableApplicationContext;
//import org.springframework.core.env.Environment;
//import java.net.InetAddress;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

import java.net.UnknownHostException;

/**
 * @author com.shent
 */
@Slf4j
@SpringBootApplication()
@EnableDiscoveryClient
public class AdminApplication {
    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class, args);
//        AnsiOutput.setEnabled(AnsiOutput.Enabled.ALWAYS);
//        new SpringApplicationBuilder(Application.class)
//                .bannerMode(Banner.Mode.CONSOLE);
//        ConfigurableApplicationContext application = SpringApplication.run(AdminApplication.class, args);
//        print(application);
    }

//    static void print(ConfigurableApplicationContext application) throws UnknownHostException {
//        Environment env = application.getEnvironment();
//        String ip = InetAddress.getLocalHost().getHostAddress();
//        String port = env.getProperty("server.port");
//        String path = env.getProperty("server.servlet.context-path");
//        if (StringUtils.isBlank(path)) {
//            path = "";
//        }
//        log.info("\n----------------------------------------------------------\n\t" +
//                "Application  is running! Access URLs:\n\t" +
//                "Local访问网址: \t\thttp://localhost:" + port + path + "\n\t" +
//                "External访问网址: \thttp://" + ip + ":" + port + path + "\n\t" +
//                "----------------------------------------------------------");
//    }
}
